from django.db import models

# Create your models here.
from django.db import models
from dingxiang.utils.models import BaseModel
from stdimage import StdImageField
from django.utils.safestring import mark_safe

# # 不支持上传文件
# from ckeditor.fields import RichTextField
# # 支持上传文件
# from ckeditor_uploader.fields import RichTextUploadingField

from disease.models import DepartmentModel

# Create your models here.

# 医院表
class HospitalModel(BaseModel):
    name = models.CharField(max_length=255, verbose_name="医院名称")
    address = models.CharField(max_length=255, verbose_name="医院地址")
    contact_info = models.CharField(max_length=255, verbose_name="联系方式")
    description = models.TextField(blank=True, null=True, verbose_name='描述信息')
    department = models.ForeignKey(DepartmentModel, on_delete=models.CASCADE, related_name="hospital_department", verbose_name='所属科室')

    class Meta:
        db_table = 'hospital'
        verbose_name_plural = '医院'

    def __str__(self):
        return self.name

